package com.romotc.qqrobot.webqq.qqInterfaceCall.base;

import java.util.ArrayList;

import org.json.JSONObject;

import com.romotc.qqrobot.bean.QQLogedin;
import com.romotc.qqrobot.webqq.qqInterfaceCall.QQInterfaceCall;
import com.romotc.qqrobot.webqq.qqInterfaceCall.dataProcessor.DateProcessor;
import com.romotc.scache.httpreq;
/**
 * 获取QQ验证码
 * http://captcha.qq.com/getimage?aid=????&0.22163592418655753
 *                           Math.random():0.7193971324899622
 * @author Administrator
 *
 */
public abstract class Getimage_InterCall extends QQInterfaceCall {
	public static final int req_method = httpreq.REQUEST_GET;
	public static final String reqUrl = "http://captcha.qq.com/getimage";
	public static final int aid = 1003901;
	private static final int logLevel = 1001;
	
	@Override
	public String buildReqBody(JSONObject reqDataObj, QQLogedin loginQQ) {
		// TODO Auto-generated method stub
		return null;
	}
	/**
Accept:
Accept-Charset:UTF-8,*;q=0.5
Accept-Encoding:gzip,deflate,sdch
Accept-Language:zh-CN,zh;q=0.8
Cookie:o_cookie=1586030808; pgv_pvid=3486543974; pgv_info=pgvReferrer=&ssid=s3875317342; verifysession=h00daeef84f3262cebd8e2368376a1cb7ba736125d0d2524c773dd31c2667653051aef56dbf79a6f3d5f05e5582e152f60e; ptui_loginuin=1586030808; pt2gguin=o1586030808; ptisp=cnc; show_id=; uin=o1586030808; skey=@Jf2uW5KKq; ptwebqq=feb4be77e51321abab707a1cc52fcc51d0ebbe8f7a3b114d
Host:captcha.qq.com
Proxy-Connection:keep-alive
Referer:http://web.qq.com/
User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7
	 */
	@Override
	public ArrayList<String> myReqHeaders(int reqBodyLen, QQLogedin loginQQ,JSONObject reqDataObj) {
		// TODO Auto-generated method stub
		return buildReqHeaders(loginQQ,
				getHeader_Referer(), "captcha.qq.com");
	}

	
	public int getReq_method() {
		return req_method;
	}

	public String getReqUrl(JSONObject reqDataObj, QQLogedin loginQQ) {
		return reqUrl + "?aid=" + getAid() + "&" + Math.random();
	}

	public abstract int getAid() ;
	public abstract String getHeader_Referer();
	
	public int getLogLevel() {
		return logLevel;
	}
	
	@Override
	public JSONObject preCall(QQLogedin loginQQ, JSONObject reqDataObj) {
		return reqDataObj;
	}

	@Override
	public boolean hasPreCall(QQLogedin loginQQ, JSONObject reqDataObj) {
		return false;
	}
	@Override
	public Class getResClassType() {
		return null;
	}

	
}
